package com.zx.tfw.enums;

import java.util.HashMap;
import java.util.Map;

public enum TagEnum {
	
	tag1		(1, "tag1"),
	tag2		(2, "tag2"),
	tag3		(3, "tag3"),
	tag4		(4, "tag4");
	
	private int code;
	
	private String name;

	private TagEnum(int code, String name) {
		this.code = code;
		this.name = name;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	private static Map<Integer, TagEnum> map;
	static {
		map = new HashMap<>();
		TagEnum[] values = TagEnum.values();
		for (TagEnum typeEnum : values) {
			map.put(typeEnum.getCode(), typeEnum);
		}
	}
	
	public static Map<Integer, TagEnum> asMap(){
		return map;
	}
	
}
